<template>
  <div class="common-header-title-wrap">
    <span class="common-title">{{ title }}</span>
    <div class="common-header-tabs">
      <slot name="tabs"></slot>
    </div>
    <div class="common-header-content">
      <slot name="header-content"></slot>
    </div>
    <div class="common-control-tools">
      <slot name="default"></slot>
    </div>
  </div>
</template>

<script>
/**
 * 通用头部组件
 * 顶部左侧标题
 * 右侧功能按钮(返回,保存,...)
 */
export default {
  name: "CommonHeader",
  props: {
    title: {
      type: String,
      default: "",
    },
  },
};
</script>

<style scoped lang="scss">
.common-header-title-wrap {
  padding: 7px 12px;
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;

  .common-title {
    color: #303133;
    font-size: 15px;
    min-width: 200px;
  }
  .common-control-tools {
    position: absolute;
    right: 12px;
  }
  .common-header-tabs {
    position: relative;
    margin-left: 18px;
    border-left: 2px solid #eee;
  }
}
</style>
